.class Lcom/bitauto/autoeasy/tool/ToolCity$2;
.super Ljava/lang/Object;
.source "ToolCity.java"

# interfaces
.implements Landroid/content/DialogInterface$OnClickListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/bitauto/autoeasy/tool/ToolCity;->DialogCity(Ljava/util/ArrayList;Lcom/bitauto/autoeasy/news/NewsActivity;I)Landroid/app/AlertDialog;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field private final synthetic val$cityList:Ljava/util/ArrayList;

.field private final synthetic val$context:Lcom/bitauto/autoeasy/news/NewsActivity;


# direct methods
.method constructor <init>(Lcom/bitauto/autoeasy/news/NewsActivity;Ljava/util/ArrayList;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 1
    iput-object p1, p0, Lcom/bitauto/autoeasy/tool/ToolCity$2;->val$context:Lcom/bitauto/autoeasy/news/NewsActivity;

    iput-object p2, p0, Lcom/bitauto/autoeasy/tool/ToolCity$2;->val$cityList:Ljava/util/ArrayList;

    .line 71
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onClick(Landroid/content/DialogInterface;I)V
    .locals 3
    .parameter "dialog"
    .parameter "item"

    .prologue
    .line 73
    iget-object v0, p0, Lcom/bitauto/autoeasy/tool/ToolCity$2;->val$context:Lcom/bitauto/autoeasy/news/NewsActivity;

    const-string v1, "autoeasy"

    const/4 v2, 0x2

    invoke-virtual {v0, v1, v2}, Lcom/bitauto/autoeasy/news/NewsActivity;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v0

    invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v1

    const-string v2, "cityid"

    iget-object v0, p0, Lcom/bitauto/autoeasy/tool/ToolCity$2;->val$cityList:Ljava/util/ArrayList;

    invoke-virtual {v0, p2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/bitauto/autoeasy/selectcar/Object/City;

    invoke-virtual {v0}, Lcom/bitauto/autoeasy/selectcar/Object/City;->getCityId()Ljava/lang/String;

    move-result-object v0

    invoke-interface {v1, v2, v0}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    move-result-object v1

    .line 74
    const-string v2, "cityname"

    iget-object v0, p0, Lcom/bitauto/autoeasy/tool/ToolCity$2;->val$cityList:Ljava/util/ArrayList;

    invoke-virtual {v0, p2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/bitauto/autoeasy/selectcar/Object/City;

    invoke-virtual {v0}, Lcom/bitauto/autoeasy/selectcar/Object/City;->getCityName()Ljava/lang/String;

    move-result-object v0

    invoke-interface {v1, v2, v0}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    const-string v1, "item"

    invoke-interface {v0, v1, p2}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 75
    iget-object v1, p0, Lcom/bitauto/autoeasy/tool/ToolCity$2;->val$context:Lcom/bitauto/autoeasy/news/NewsActivity;

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v0, "http://m.bitauto.com/appapi/News/List.ashx/?type=2&city="

    invoke-direct {v2, v0}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v0, p0, Lcom/bitauto/autoeasy/tool/ToolCity$2;->val$cityList:Ljava/util/ArrayList;

    invoke-virtual {v0, p2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/bitauto/autoeasy/selectcar/Object/City;

    invoke-virtual {v0}, Lcom/bitauto/autoeasy/selectcar/Object/City;->getCityId()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    iput-object v0, v1, Lcom/bitauto/autoeasy/news/NewsActivity;->url:Ljava/lang/String;

    .line 76
    iget-object v0, p0, Lcom/bitauto/autoeasy/tool/ToolCity$2;->val$context:Lcom/bitauto/autoeasy/news/NewsActivity;

    invoke-virtual {v0}, Lcom/bitauto/autoeasy/news/NewsActivity;->RunTask()V

    .line 77
    invoke-interface {p1}, Landroid/content/DialogInterface;->dismiss()V

    .line 78
    return-void
.end method
